define([
    "ngController"
],function (appAngular) {

    // 底部按钮先关-可拖动模块-5、搜索
    appAngular.directive("bimApiModelSearch", function () {
        return {
            restrict: "EA",
            replace: true,
            template: `<div class="draggable model-search" 
                            style="display: {{(btnsSelect.name=='search'&&btnsSelect.check == true)?'block':'none'}}">
						<div class="search-header">
							<div class="dropdown">
								<button class="dropbtn" title="{{modelSearch.selectVal}}">
									<span class="dropbtn-text">{{modelSearch.selectVal}}</span>
								</button>
								<div class="dropdown-content">
									<a ng-repeat="item in modelSearch.searchScope" ng-click="modelSearchDropdownSelect(item)">{{item}}</a>
								</div>
							</div>
							<div class="search-input">
								<label>
				            		<img src="{{baseUrl + imgSearch}}">
				            		<input type="text" placeholder="搜索内容" ng-model="modelSearch.searchVal">
				          		</label>
								<button>搜索</button>
							</div>
							<img ng-src="{{baseUrl + imgDragClose}}" ng-click="modelDragTitleClose()">
						</div>
					</div>`,
            link: function ($scope, $elem, attrs) {
                // 模型中-5-搜索
                $scope.modelSearch = {
                    searchScope: ['全局', '模型结构', '视角书签', '标注'],
                    selectVal: '全局',
                    searchVal: ''
                };
            }
        };
    });

    return appAngular;
});